package com.hospital.medicals.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.medicals.entity.MedicalUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;

public interface MedicalUserMapper extends BaseMapper<MedicalUser> {
    @Select("select * from medicals")
    List<MedicalUser> getSelect();

    @Insert("insert into medicals(id,username,email,mobile,role) values (#{id},#{username},#{email},#{mobile},#{role)")
    void insertMedical(MedicalUser medicalUser);

    @Delete("delete from medicals where id=#{id}")
    void deleteMedical(int id);

    @Update("update medicals set username=#{username},email=#{email},mobile=#{mobile},role=#{role} where id=# {id}")
    void updateMedical(MedicalUser medicalUser);
}

